package vip.mall.modular.uiapp.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.mall.common.params.CommonPageParams;
import vip.mall.common.result.CommonResult;
import vip.mall.modular.uiapp.params.QuestionsAddParams;
import vip.mall.modular.uiapp.service.QuestionService;

/**
 * @author ASUS
 * @Date 2025/6/17 10:59
 * @Descripition
 */
@RestController
@RequestMapping("/Question")
@Tag(name = "试题管理", description = "试题表")
public class QuestionController {
    @Resource
    private QuestionService questionService;
    @PostMapping("/add")
    @Operation(summary = "增加试题")
    public CommonResult add(@RequestBody QuestionsAddParams questionsAddParams) {
        return questionService.add(questionsAddParams)? CommonResult.success() : CommonResult.error();
    }
    @PostMapping("/page")
    @Operation(summary = "分页获取试题列表")
    public CommonResult page(@RequestBody CommonPageParams commonPageParams){
        return CommonResult.success(questionService.pageList(commonPageParams));
    }
}
